From 3ce3593ebf334f0bee2497732ebce8958e9950e0 Mon Sep 17 00:00:00 2001 From: Rafal Luzynski Date: Thu, 26 Feb 2015 02:15:18 +0100 Subject: [PATCH] GtkListBoxRow: add g_return_if_fail to grab_focus, don't crash Although gtk_list_box_row_grab_focus() is not a public function it can be easily called by gtk_widget_grab_focus() with a row argument which has been removed from the list box and has box == NULL. https://bugzilla.gnome.org/show_bug.cgi?id=744879 --- gtk/gtklistbox.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c index 06ccaee784..b270910a9a 100644 --- a/gtk/gtklistbox.c +++ b/gtk/gtklistbox.c @@ -3487,6 +3487,8 @@ gtk_list_box_row_grab_focus (GtkWidget *widget) GtkListBoxRow *row = GTK_LIST_BOX_ROW (widget); GtkListBox *box = gtk_list_box_row_get_box (row); + g_return_if_fail (box != NULL); + if (BOX_PRIV (box)->cursor_row != row) gtk_list_box_update_cursor (box, row, FALSE); -- 2.30.2